home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
cptuts22.arj
/
TRUCK.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-20
|
416b
|
28 lines
// Chapter 7 - Program 7
#include "truck.h"
void truck::init_truck(int how_many, float max_load)
{
passenger_load = how_many;
payload = max_load;
}
float truck::efficiency(void)
{
return payload / (payload + weight);
}
int truck::passengers(void)
{
return passenger_load;
}
// Result of execution
//
// (this file cannot be executed)